home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8095 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news.internetMCI.com!news-admin
  2. From: 74133.2732@compuserve.com
  3. Newsgroups: comp.lang.c++
  4. Subject: Creating a 'factory'
  5. Date: 14 Feb 1996 15:58:19 GMT
  6. Organization: InternetMCI
  7. Message-ID: <4ft0qr$10t@news.internetmci.com>
  8. Reply-To: 74133.2732@compuserve.com (Rich Knapp)
  9. NNTP-Posting-Host: 166.35.209.252
  10. X-Newsreader: IBM NewsReader/2 v1.2
  11.  
  12. I'm trying to build a framework for processing files.  Each process has an
  13. input file and an output file (ASCII).  I've built, from a common File object, 
  14. an InputFile and OutputFile object.  As part of the functionality, I wanted to
  15. provide the extraction (>>) and insertion (<<) operator in these classes.  
  16.  The InputFile uses getline() to retrieve data for the file.  It leaves
  17. the CR on the data line but strips the LF.
  18.  The OutputFile  only inserts the LF, not the CR (checked for hex pair
  19. OD and OA).  I commented out the insertion operator to see if I was 
  20. running into trouble directing the output.  No impact on the output.  I tried
  21. a generic stream output and successfully used the << with the correct CR/LF
  22. pair.
  23.   I can force the CR/LF by putting "/r/n" in the passed character string but
  24. shouldn't the endl also pass that information.
  25.   I'm really confused on this.  BTW, I'm using old Turbo C++ 3.0.  (could that
  26. be the problem?)
  27.  
  28. rich
  29.